//
//  YRJAllTripValuedCollectionViewCell.m
//  YanRenjie
//
//  Created by dllo on 15/10/28.
//  Copyright (c) 2015年 yanrenjie. All rights reserved.
//

#import "YRJAllTripValuedCollectionViewCell.h"
#import "YRJTripHeader.h"


@implementation YRJAllTripValuedCollectionViewCell
- (void)dealloc {
    [_photoImageView release];
    [_titleLabel release];
    [_priceLabel release];
    [_priceoffLabel release];
    
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self createCell];
    }
    return self;
}

- (void)createCell {
    self.photoImageView = [[UIImageView alloc] init];
    [self.contentView addSubview:self.photoImageView];
    [_photoImageView release];
    self.photoImageView.layer.borderWidth = 1;
    
    self.titleLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.titleLabel];
    [_titleLabel release];
    //self.titleLabel.layer.borderWidth = 1;
    self.titleLabel.font = [UIFont systemFontOfSize:12];
    self.titleLabel.numberOfLines = 2;
    self.titleLabel.backgroundColor = [UIColor colorWithRed:220 / 255.0 green:220 / 255.0 blue:220 / 255.0 alpha:0.6];
    
    self.priceLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.priceLabel];
    [_priceLabel release];
    //self.priceLabel.layer.borderWidth = 1;
    self.priceLabel.font = [UIFont systemFontOfSize:10];
    self.priceLabel.backgroundColor = [UIColor colorWithRed:220 / 255.0 green:220 / 255.0 blue:220 / 255.0 alpha:0.6];
    
    self.priceoffLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.priceoffLabel];
    [_priceoffLabel release];
    //self.priceoffLabel.layer.borderWidth = 1;
    self.priceoffLabel.font = [UIFont systemFontOfSize:10];
    self.priceoffLabel.backgroundColor = [UIColor colorWithRed:220 / 255.0 green:220 / 255.0 blue:220 / 255.0 alpha:0.6];
}

- (void)layoutSubviews {
    [super layoutSubviews];
    self.photoImageView.frame = CGRectMake(kWidth / 32 * 2, kHeight / 16, kWidth / 32 * 14 * 2, kHeight / 16 * 9);
    self.titleLabel.frame = CGRectMake(kWidth / 32 * 2, kHeight / 16 * 10, kWidth / 32 * 14 * 2, kHeight / 16 * 3);
    self.priceoffLabel.frame = CGRectMake(kWidth / 32 * 2, kHeight / 16 * 13, kWidth / 32 * 7 * 2, kHeight / 16 * 2);
    self.priceLabel.frame = CGRectMake(kWidth / 32 * 8 * 2, kHeight / 16 * 13, kWidth / 32 * 7 * 2, kHeight / 16 * 2);
}
@end
